# # -*- coding: utf-8 -*-
# #
# # Author:: hanjunfeng
# # Date:: 2022/7/7
# import os
#
# from submodules.common.lib.datetime_ import get_date
# from submodules.common.lib.json_ import json_file_to_dict
# from submodules.common.lib.local_paths import project_tmp_path
#
# import tushare as ts
#
# from lib.indicator import get_ma_list, get_boll_list
# from lib.ts_ import get_latest_date
#
# pro = ts.pro_api()
#
# latest_date = get_latest_date()
# today_date_del50 = get_date(-80)
#
#
# def main():
#     file_path = os.path.join(project_tmp_path, "top_stock_list.json")
#     d = json_file_to_dict(file_path)
#     tx_code_list = [x[0] for x in d]
#     tx_code_list = tx_code_list[:10]
#     for tx_code in tx_code_list:
#         ts_code = tx_code_to_ts_code(tx_code)
#         candles_data = get_candles_data(ts_code)
#         ma_list_type3 = get_ma_list(candles_data, ma_type=3, offset=0)
#         ma_list_type15 = get_ma_list(candles_data, ma_type=15, offset=0)
#         boll_list_type15 = get_boll_list(candles_data, mid=15, offset=0)
#
#         break
#
#
# if __name__ == "__main__":
#     def test_get_candles_data():
#         res = get_candles_data("001979.SZ")
#         print(res)
#
#
#     test_get_candles_data()
